package ink.lovejinhu.leetcodeMatch;

/**
 * @author jinhu
 * created 2021-08-01 10:52
 */
public class Solution_5187 {
    public long minimumPerimeter(long neededApples) {
        if (neededApples <= 12) return 8;
        for (long i = 2; i < neededApples; i += 2) {
            long y2 = i * (1 + i / 2) * (i + 1);
            if (neededApples <= y2) return i * 4;
        }
        return 0;
    }
}
